<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>阅读列表</title>
    <link rel="stylesheet" th:href="@{/style.css}"/>
</head>
<body>
<form method="POST" th:action="@{/logout}">
    <input type="submit" value="登出"/>
</form>
<h2><span th:text="${reader.fullname}">姓名</span>的阅读列表</h2>
<div th:unless="${#lists.isEmpty(books)}">
    <dl th:each="book : ${books}">
        <dt class="bookHeadline">
            <a th:href="'http://www.amazon.com/gp/product/'+ ${book.isbn} + '/tag='+${amazonID}"
               th:text="${book.title}">书籍名称</a>
            作者：
            <span th:text="${book.author}">作者</span>
            (ISBN: <span th:text="${book.isbn}">ISBN</span>)
        </dt>
        <dd class="bookDescription">
            <span th:if="${book.description}" th:text="${book.description}">描述</span>
            <span th:if="${book.description eq null}">没有描述</span>
        </dd>
    </dl>
</div>
<div th:if="${#lists.isEmpty(books)}">
    <p>您还没有要读的书籍</p>
</div>
<hr/>
<h3>添加书籍</h3>
<form method="POST" th:action="@{/}">
    <label for="title">书籍名称:</label>
    <input id="title" type="text" name="title" size="50"/><br/>
    <label for="author">作者:</label>
    <input id="author" type="text" name="author" size="50"/><br/>
    <label for="isbn">ISBN:</label>
    <input id="isbn" type="text" name="isbn" size="15"/><br/>
    <label for="description">描述:</label><br/>
    <textarea id="description" name="description" cols="80" rows="5"></textarea><br/>
    <!--Could not verify the provided CSRF token because your session was not found.-->
    <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
    <input type="submit"/>
</form>
</body>
</html>